package com.qkst.website.backstage.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * jqGrid响应结果bean
 * @author lh
 * @description 
 * @date 2017年5月18日 下午2:36:29
 * @email ahlxlihao@163.com
 * 
 */
public class ResultBean<T> implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -2501183343470253420L;
	
	private int page;//当前页数

	private int total;//总页数
	
	private int records;//总记录数
	
	private int size;//每页行数
	
	private List<T> rows = new ArrayList<T>();//查询结果集
	
	private T row;//查询结果
	
	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getTotal() {
		if(this.records%this.size==0){//如果能被整除
			total=this.records/this.size;
		}else{
			total=this.records/this.size+1;
		}
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getRecords() {
		
		return records;
	}

	public void setRecords(int records) {
		this.records = records;
	}
	
	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public List<T> getRows() {
		return rows;
	}

	public void setRows(List<T> rows) {
		this.rows = rows;
	}

	public T getRow() {
		return row;
	}

	public void setRow(T row) {
		this.row = row;
	}

}
